<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改密码</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.">
<link rel="stylesheet" href="resources/css/weui.min.css">
<link rel="stylesheet" href="resources/css/jquery-weui.css">
<link rel="stylesheet" href="resources/css/style.css">
</head>
<body ontouchstart>
<!--主体-->
<header class="wy-header">
  <div class="wy-header-icon-back"><span></span></div>
  <div class="wy-header-title">修改密码</div>
</header>
<div class="weui-content">
  <div class="weui-cells weui-cells_form wy-address-edit">
    <div class="weui-cell">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">新密码</label></div>
      <div class="weui-cell__bd"><input class="weui-input" placeholder="请输入新密码"></div>
    </div>
    <div class="weui-cell weui-cell_vcode">
        <div class="weui-cell__hd">
            <label class="weui-label wy-lab">验证码</label>
        </div>
        <div class="weui-cell__bd">
            <input class="weui-input" placeholder="请输入验证码" type="number">
        </div>
        <div class="weui-cell__ft">
            <button class="weui-vcode-btn" onclick="settime(this)">获取验证码</button>
        </div>
    </div>
  </div>
  <div class="weui-btn-area"><a href="javascript:;" class="weui-btn weui-btn_primary">确认修改</a></div>
</div>


<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/fastclick.js"></script> 
<script src="resources/js/jquery-weui.min.js"></script>
<script src="resources/js/jquery.Spinner.js"></script>  
<script>
var countdown=60;
var flag = true;
function settime(obj) {
	if(flag){
		flag = false;		
		$.post('autoUserValidate',{"explainCode":1},(result)=>{
	        	if(result.errorCode==0){$.toast(result.errorMsg);}
	        	else{$.toast(result.errorMsg, "cancel");}
	    }).error(()=>{$.toast("发送验证码失败", "cancel");});
	}
    var code = $(obj);
    if (countdown == 0) {
        code.removeAttr('disabled');
        code.text("获取验证码");
        countdown = 60;
        flag = true;
        return;
    } else {
        code.text("重新发送(" + countdown + ")");
        code.attr('disabled',true);
        countdown--;
    }
    setTimeout(function() {
        settime(obj) }, 1000);
}
// 回退
$(".wy-header-icon-back").click(()=>{window.history.back();})
// fastclick
$(function() {
    FastClick.attach(document.body);
});
</script>
</body>
</html>
